Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For missing font, use a local font if it exists even if there's no standard substitution #16416

Merged
merged 1 commit into from
May 14, 2023

Conversation

calixteman
Copy link
Contributor

If the font foo is missing we just try lo load local(foo) and maybe we'll be lucky.

@calixteman calixteman linked an issue May 13, 2023 that may be closed by this pull request
Snuffleupagus
Snuffleupagus previously approved these changes May 13, 2023
Copy link
Collaborator

@Snuffleupagus Snuffleupagus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that we could now be passing an undefined standardFontName to the getFontSubstitution function, please update this part of the JSDoc to actually reflect that:

  * @param {String} [standardFontName] The standard font name to use if the base
  *   font is not available. 

r=me, with the above fixed and passing tests; thank you!

@calixteman
Copy link
Contributor Author

/botio test

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_test from @calixteman received. Current queue size: 0

Live output at: http://54.241.84.105:8877/dd00bfe9c9ecbd7/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_test from @calixteman received. Current queue size: 0

Live output at: http://54.193.163.58:8877/76aa23f3a8d118e/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/dd00bfe9c9ecbd7/output.txt

Total script time: 26.82 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Integration Tests: FAILED
  • Regression tests: FAILED
  different ref/snapshot: 67

Image differences available at: http://54.241.84.105:8877/dd00bfe9c9ecbd7/reftest-analyzer.html#web=eq.log

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/76aa23f3a8d118e/output.txt

Total script time: 34.38 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Integration Tests: FAILED
  • Regression tests: FAILED
  different ref/snapshot: 57

Image differences available at: http://54.193.163.58:8877/76aa23f3a8d118e/reftest-analyzer.html#web=eq.log

@Snuffleupagus Snuffleupagus dismissed their stale review May 13, 2023 15:10

Potentially too much movement in ref-tests

@Snuffleupagus
Copy link
Collaborator

Snuffleupagus commented May 13, 2023

Looking at the Windows bot, there's a few things that doesn't look like improvements:

  • firefox-issue9195-page1, there's no longer a bold font being used.
  • firefox-issue1096-page1, firefox-non-embedded-NuptialScript-page1, firefox-issue6117-page6; no longer uses a serif-font (Adobe Reader renders these with serif-fonts).

@Snuffleupagus
Copy link
Collaborator

Given some of the test "failures", should we perhaps pass in the font-flags to the getFontSubstitution-function such that we're able to better choose between serif and sans-serif fonts in the fallback?

@calixteman
Copy link
Contributor Author

Given some of the test "failures", should we perhaps pass in the font-flags to the getFontSubstitution-function such that we're able to better choose between serif and sans-serif fonts in the fallback?

Yep, the flags aren't available when getFontSubstitution is called but it's the idea. I'll push my update soon.

src/core/font_substitutions.js Outdated Show resolved Hide resolved
src/core/fonts.js Outdated Show resolved Hide resolved
src/display/font_loader.js Outdated Show resolved Hide resolved
@Snuffleupagus
Copy link
Collaborator

/botio browsertest

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_browsertest from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.193.163.58:8877/19b5100eadcea02/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_browsertest from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.241.84.105:8877/2d31618adb8f135/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/2d31618adb8f135/output.txt

Total script time: 22.57 mins

  • Regression tests: FAILED
  different ref/snapshot: 51
  different first/second rendering: 1

Image differences available at: http://54.241.84.105:8877/2d31618adb8f135/reftest-analyzer.html#web=eq.log

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/19b5100eadcea02/output.txt

Total script time: 23.63 mins

  • Regression tests: FAILED
  different ref/snapshot: 36

Image differences available at: http://54.193.163.58:8877/19b5100eadcea02/reftest-analyzer.html#web=eq.log

@Snuffleupagus
Copy link
Collaborator

That looks better, however we still have some "problems" at least on the Windows bot:

  • firefox-issue9195-page1, some of the text still isn't bold as expected.
  • firefox-issue11915-page1, the Arial Italic font isn't working correctly (the font is named /Arial-ItalicMT,Italic).

@calixteman calixteman force-pushed the use_local_font_2 branch 2 times, most recently from f23fce6 to 74ea376 Compare May 13, 2023 17:19
@calixteman
Copy link
Contributor Author

About issue11915, I added the font in the standard font map and the "weird" aspect is because we've an italic monospace (because the font is detected as monospace).
The monospace flag is because of:
https://github.com/mozilla/pdf.js/blob/master/src/core/evaluator.js#L3961
and it's why in the last version of the patch I clear the bit if it's required.

@calixteman
Copy link
Contributor Author

/botio browsertest

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_browsertest from @calixteman received. Current queue size: 0

Live output at: http://54.193.163.58:8877/e4169ec57242361/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_browsertest from @calixteman received. Current queue size: 0

Live output at: http://54.241.84.105:8877/fa8d0765b46d8d9/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Success

Full output at http://54.193.163.58:8877/e4169ec57242361/output.txt

Total script time: 3.16 mins

  • Regression tests: Passed

@calixteman
Copy link
Contributor Author

/botio-windows browsertest

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_browsertest from @calixteman received. Current queue size: 0

Live output at: http://54.193.163.58:8877/7f4e35146d2dcba/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/fa8d0765b46d8d9/output.txt

Total script time: 22.37 mins

  • Regression tests: FAILED
  different ref/snapshot: 52
  different first/second rendering: 1

Image differences available at: http://54.241.84.105:8877/fa8d0765b46d8d9/reftest-analyzer.html#web=eq.log

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/7f4e35146d2dcba/output.txt

Total script time: 23.10 mins

  • Regression tests: FAILED
  different ref/snapshot: 171

Image differences available at: http://54.193.163.58:8877/7f4e35146d2dcba/reftest-analyzer.html#web=eq.log

@Snuffleupagus
Copy link
Collaborator

It seems that the ArialBlack has now regressed on Windows, see e.g. firefox-artofwar (many pages), firefox-issue5801-page1, and firefox-issue7835-page1.

…andard substitution

If the font foo is missing we just try lo load local(foo) and maybe
we'll be lucky.
@calixteman
Copy link
Contributor Author

/botio browsertest

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_browsertest from @calixteman received. Current queue size: 0

Live output at: http://54.241.84.105:8877/664d496ba2d319c/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_browsertest from @calixteman received. Current queue size: 0

Live output at: http://54.193.163.58:8877/f410110659e031b/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Success

Full output at http://54.193.163.58:8877/f410110659e031b/output.txt

Total script time: 3.64 mins

  • Regression tests: Passed

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/664d496ba2d319c/output.txt

Total script time: 22.52 mins

  • Regression tests: FAILED
  different ref/snapshot: 51
  different first/second rendering: 1

Image differences available at: http://54.241.84.105:8877/664d496ba2d319c/reftest-analyzer.html#web=eq.log

@calixteman
Copy link
Contributor Author

/botio-windows browsertest

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_browsertest from @calixteman received. Current queue size: 0

Live output at: http://54.193.163.58:8877/d91f1c76faed2ea/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/d91f1c76faed2ea/output.txt

Total script time: 23.18 mins

  • Regression tests: FAILED
  different ref/snapshot: 49

Image differences available at: http://54.193.163.58:8877/d91f1c76faed2ea/reftest-analyzer.html#web=eq.log

Copy link
Collaborator

@Snuffleupagus Snuffleupagus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems to work, and improves Calibri fonts on Windows. (It's too bad that the getFontSubstitution function becomes even more complex, but I suppose that cannot really be helped.)

r=me, thank you!

@calixteman calixteman merged commit 202496a into mozilla:master May 14, 2023
@calixteman
Copy link
Contributor Author

/botio makeref

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_makeref from @calixteman received. Current queue size: 0

Live output at: http://54.193.163.58:8877/cd637d4af7d1ad5/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_makeref from @calixteman received. Current queue size: 0

Live output at: http://54.241.84.105:8877/a9057b45bd5f9b4/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/a9057b45bd5f9b4/output.txt

Total script time: 23.32 mins

  • Lint: Passed
  • Make references: Passed
  • Check references: Passed

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Success

Full output at http://54.193.163.58:8877/cd637d4af7d1ad5/output.txt

Total script time: 24.78 mins

  • Lint: Passed
  • Make references: Passed
  • Check references: Passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multiple issues for an NVIDIA pdf
3 participants